A multithreaded program is one in which there are multiple threads of control. A lock is a synchronization mechanism for enforcing limits on access to a resource in a multithreaded environment such that concurrency control is enforced. Another way of enforcing concurrency control is by using atomic sections. An atomic section refers to a section of code which provides atomicity, consistency, and isolation guarantees.